package com.hjp.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.hjp.dao.IUserDao;
import com.hjp.model.User;
import com.hjp.service.IUserSerivce;

@Service
//@Transactional
public class UserServiceImpl implements IUserSerivce{

	private IUserDao userDao;

	@Resource
	public void setUserDao(IUserDao userDao) {
		this.userDao = userDao;
	}

	@Override
	public void save(User entity) {
		// TODO Auto-generated method stub
		userDao.save(entity);
		
	}

	@Override
	public void delete(Long id) {
		// TODO Auto-generated method stub
		userDao.delete(id);		
	}

	@Override
	public void update(User entity) {
		// TODO Auto-generated method stub
		userDao.update(entity);
	}

	@Override
	public User getById(Long id) {
		// TODO Auto-generated method stub
		return userDao.getById(id);
	}

	@Override
	public List<User> getByIds(Long[] ids) {
		// TODO Auto-generated method stub
		return userDao.getByIds(ids);
	}

	@Override
	public List<User> findAll() {
		// TODO Auto-generated method stub
		return userDao.findAll();
	}
	

}
